﻿package net.wangit.view.chart.impl;

import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.renderer.category.LineRenderer3D;
import org.jfree.chart.urls.StandardCategoryURLGenerator;
import org.jfree.data.category.CategoryDataset;

public class Line3DChart extends CategoryChart {

	public Line3DChart() {
	}

	protected CategoryPlot getCategoryPlot() {
		CategoryDataset dataset = (CategoryDataset) getDataset();
		org.jfree.chart.axis.CategoryAxis categoryAxis = getCategoryAxis3D();
		org.jfree.chart.axis.ValueAxis valueAxis = getNumberAxis3D();
		LineRenderer3D renderer = getRenderer();
		CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
				renderer);
		return plot;
	}

	private LineRenderer3D getRenderer() {
		LineRenderer3D renderer = new LineRenderer3D();
		if (tooltips)
			renderer
					.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
		if (urls)
			renderer
					.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
		configCategoryRenderer(renderer);
		return renderer;
	}
}
